package com.huiquan.icd.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.huiquan.framework.base.EnhancedBaseDao;
import com.huiquan.icd.domain.IcdDiseaseNationalStd;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class IcdDiseaseNationalStdDao extends EnhancedBaseDao<IcdDiseaseNationalStd> {

	@Resource(name = "sqlMapClient")
	private SqlMapClient sqlMapClient;

	public static final String space = "ICD_DISEASE_NATIONAL_STD.";

	public IcdDiseaseNationalStdDao() {
		super(space);
	}

	public void changeDisable(String id, Long uid, String disable) {
		Map<String, Object> param = new HashMap<>();
		param.put("id", id);
		param.put("disable", disable);
		param.put("uid", uid);
		update(space + "UPDATE_DISABLE", param, sqlMapClient);
	}

	@SuppressWarnings("unchecked")
	public List<IcdDiseaseNationalStd> retrieveAllNationalDisease() {
		return (List<IcdDiseaseNationalStd>) this.list(space + "RETRIEVE_ALL_NATIONAL_DISEASE", sqlMapClient);
	}
	
	@SuppressWarnings("unchecked")
	public List<IcdDiseaseNationalStd> retrieveNationalByDisease(String diseaseName) {
		Map<String, Object> param = new HashMap<>();
		param.put("diseaseName", diseaseName);
		return (List<IcdDiseaseNationalStd>) this.list(space + "RETRIEVE_NATIONAL_DISEASE_BY_DISEASE_NAME", sqlMapClient);
	}
}
